//
//  OptionImageView.m
//  dingdang
//
//  Created by 阮 沧晖 on 15/9/3.
//  Copyright (c) 2015年 阮 沧晖. All rights reserved.
//

#import "OptionImageView.h"
#import "MWPhoto.h"
@implementation OptionImageView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/


- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    
//    //[[NSNotificationCenter defaultCenter] postNotificationName:@"clearTagView" object:nil];
//    NSLog(@"%@",touches);
//    NSSet *allTouches = [event allTouches];    //返回与当前接收者有关的所有的触摸对象
//    UITouch *touch = [allTouches anyObject];   //视图中的所有对象
//    CGPoint point = [touch locationInView:[touch view]]; //返回触摸点在视图中的当前坐标
//    int x = point.x;
//    int y = point.y;
//    NSLog(@"touch (x, y) is (%d, %d)", x, y);
//    if (_popMediaView) {
//        _popMediaView(point);
//    }
    
    NSLog(@"998");
    _photos = [NSMutableArray array];
        NSString *url = self.url;
        NSRange range = [url rangeOfString:@"http://"];//判断字符串是否包含
        if (range.length >0)//包含
        {
            MWPhoto   *photo = [MWPhoto photoWithURL:[NSURL URLWithString:url]];
            //photo.caption = _friendInfo.username;
            [_photos addObject:photo];
        }
     [[NSNotificationCenter defaultCenter]  postNotificationName:@"DisPlayImage" object:_photos];

    
    
}
@end
